package com.bolt.report.definition;

import com.bolt.report.util.ToolUtil;

/**
 * 1mm=2.83pt,1pt=0.35mm
 */
public class PaperSize {
    private float width;
    private float height;

    public enum SizeUnit {
        MM,
        PX,
        PT;
    }

    public PaperSize(int width, int height, SizeUnit unit) {
        this.width = (unit == SizeUnit.MM) ? width : ToolUtil.mmToPixel(width);
        this.height = (unit == SizeUnit.MM) ? height : ToolUtil.mmToPixel(height);
    }

    public float getWidth() {
        return width;
    }

    public void setWidth(float width) {
        this.width = width;
    }

    public float getHeight() {
        return height;
    }

    public void setHeight(float height) {
        this.height = height;
    }




}